package com.gitee.wsl.time.chinese

import kotlin.test.Test
import kotlin.test.assertEquals


/**
 * 农历月测试
 *
 * @author 6tail
 */
class LunarMonthTest {
    @Test
    fun test() {
        val month = LunarMonth.fromYm(2023, 1)
        assertEquals(1, month.index)
        assertEquals("甲寅", month.ganZhi)
    }

    @Test
    fun test1() {
        val month = LunarMonth.fromYm(2023, -2)
        assertEquals(3, month.index)
        assertEquals("丙辰", month.ganZhi)
    }

    @Test
    fun test2() {
        val month = LunarMonth.fromYm(2023, 3)
        assertEquals(4, month.index)
        assertEquals("丁巳", month.ganZhi)
    }

    @Test
    fun test3() {
        val month = LunarMonth.fromYm(2024, 1)
        assertEquals(1, month.index)
        assertEquals("丙寅", month.ganZhi)
    }

    @Test
    fun test4() {
        val month = LunarMonth.fromYm(2023, 12)
        assertEquals(13, month.index)
        assertEquals("丙寅", month.ganZhi)
    }

    @Test
    fun test5() {
        val month = LunarMonth.fromYm(2022, 1)
        assertEquals(1, month.index)
        assertEquals("壬寅", month.ganZhi)
    }

    @Test
    fun test6() {
        val month = LunarMonth.fromYm(2023, 9)
        assertEquals("癸亥", month.ganZhi)
    }
}
